package cn.wolfcode.luowowo.util;

import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

@Getter
@Setter
public class TravelCondition {
    private int min; // 最大值
    private int max; // 最小值

    // 表示天数范围
    public static final Map<Integer, TravelCondition> DAY_TYPE = new HashMap<>();

    // 表示人均花费范围
    public static final Map<Integer, TravelCondition> PER_EXPEND_TYPE = new HashMap<>();

    // 表示出发时间范围
    public static final Map<Integer, TravelCondition> TRAVEL_TIME_TYPE = new HashMap<>();

    public TravelCondition(int min, int max) {
        this.min = min;
        this.max = max;
    }

    static {
        DAY_TYPE.put(-1, null);
        DAY_TYPE.put(1, new TravelCondition(0, 3));
        DAY_TYPE.put(2, new TravelCondition(4, 7));
        DAY_TYPE.put(3, new TravelCondition(8, 14));
        DAY_TYPE.put(4, new TravelCondition(15, Integer.MAX_VALUE));

        PER_EXPEND_TYPE.put(-1, null);
        PER_EXPEND_TYPE.put(1, new TravelCondition(1, 999));
        PER_EXPEND_TYPE.put(2, new TravelCondition(1000, 6000));
        PER_EXPEND_TYPE.put(3, new TravelCondition(6001, 20000));
        PER_EXPEND_TYPE.put(4, new TravelCondition(20001, Integer.MAX_VALUE));

        TRAVEL_TIME_TYPE.put(-1, null);
        TRAVEL_TIME_TYPE.put(1, new TravelCondition(1, 2));
        TRAVEL_TIME_TYPE.put(2, new TravelCondition(3, 4));
        TRAVEL_TIME_TYPE.put(3, new TravelCondition(5, 6));
        TRAVEL_TIME_TYPE.put(4, new TravelCondition(7, 8));
        TRAVEL_TIME_TYPE.put(5, new TravelCondition(9, 10));
        TRAVEL_TIME_TYPE.put(6, new TravelCondition(11, 12));
    }
}
